function getOptionsCN(type1,type2,isShowAll){
	var items;
	var url =  baseURL+'/getDicyType.action';
	$.ajax({
		url : url + '?type1='+type+"&type2="+type2,
		async : false,
		success : function(json) {
			items = json.list;
		}
	});
	
	var options = "";
	if(isShowAll==1){
		options = "<option></option>";
	}
	if(isShowAll==2){
		options = "<option>请选择</option>";
	}
	
	for(var i=0;i<items.length;i++){
		op = "<option value="+items[i].code+">"+items[i].value+"</option>";
		options = options + op;
	}
	return options;
}

function getOptionsCNVal(type,isShowAll,val){
	var items;
	var url =  baseURL+'/enumberation/getParamsByType.action';
	$.ajax({
		url : url + '?type='+type,
		async : false,
		success : function(json) {
			items = json.list;
		}
	});
	
	var options = "<option>ALL</option>";
	if(isShowAll==1){
		options = "";
	}else if(isShowAll==2){
		options = "<option>请选择</option>";
	}
	for(var i=0;i<items.length;i++){
		if(val==items[i].enumCode){
			op = "<option value="+items[i].enumCode+" selected>"+items[i].enumName+"</option>";
		}else{
			op = "<option value="+items[i].enumCode+">"+items[i].enumName+"</option>";
		}
		
		options = options + op;
	}
	return options;
}

function getOptionsEx(modelType,isShowAll){
	var url =  "";
	if(modelType=="baseName"){
		url =   baseURL+"/airinfo/getAllBaseName.action";
	}else if(modelType=="tailNr"){
		url =   baseURL+"/tailnr/getAllTailNr.action";
	}else if(modelType=="fleet"){
		url =   baseURL+"/tailnr/getAllFleetCd.action";
	}else if(modelType=="company"){
		url =   baseURL+"/tailnr/getAllCompany.action";
	}else if(modelType=="customer"){
		url =   baseURL+"/tailnr/getAllCustomer.action";
	}else if(modelType=="depCd"){
		url =   baseURL+"/airinfo/getAllAirInfo.action";
	}else if(modelType=="personType"){
		url =   baseURL+"/addrperson/getAllPersonType.action";
	}else if(modelType=="personName"){
		url =   baseURL+"/addrperson/getAllPersonName.action";
	}else if(modelType=="addrDept"){
		url =   baseURL+'/addrperson/getAllDept.action';
	}else if(modelType=="tailNrAsign"){
		url =   baseURL+"/tailnr/getAllTailNrAsignHel.action";
	}
	var items;
	$.ajax({
		url : url,
		async : false,
		success : function(json) {
			items = json.list;
		}
	});
	
	var options = "<option>ALL</option>";
	if(isShowAll==1){
		options = "<option></option>";
	}else if(isShowAll == 2){
		options = "<option>请选择</option>";
	}else if(isShowAll == 3){
		options = "<option value=''>请选择</option>";
	}
	
	if(items == 'undefined' || typeof(items) == 'undefined'){
		return options;
	}
	
	for(var i=0;i<items.length;i++){
		if(modelType=="baseName" || modelType=="tailNr" || modelType=="fleet"
			|| modelType=="company" || modelType=="customer" || modelType=="personType" || modelType=="tailNrAsign"){
			op = "<option value='"+items[i]+"'>"+items[i]+"</option>";
		}else if(modelType=="addrDept"){
			op = "<option value='"+items[i].deptId+"'>"+items[i].deptName+"</option>";
		}else if(modelType=="personName"){
			op = "<option value='"+items[i].code+"'>"+items[i].name+"</option>";
		}else if(modelType=="depCd"){
			var ite = items[i].split("&");
			op = "<option value='"+ite[0]+"'>"+ite[1]+"</option>";
		}
		options = options + op;
	}
	return options;
}

function getOptionsExVal(modelType,isShowAll,val){
	var url =  "";
	if(modelType=="baseName"){
		url =   baseURL+"/airinfo/getAllBaseName.action";
	}else if(modelType=="tailNr"){
		url =   baseURL+"/tailnr/getAllTailNr.action";
	}else if(modelType=="fleet"){
		url =   baseURL+"/tailnr/getAllFleetCd.action";
	}else if(modelType=="company"){
		url =   baseURL+"/tailnr/getAllCompany.action";
	}else if(modelType=="customer"){
		url =   baseURL+"/tailnr/getAllCustomer.action";
	}else if(modelType=="depCd"){
		url =   baseURL+"/airinfo/getAllAirInfo.action";
	}else if(modelType=="personName"){
		url =   baseURL+"/addrperson/getAllPersonName.action";
	}
	var items;
	$.ajax({
		url : url,
		async : false,
		success : function(json) {
			items = json.list;
		}
	});
	
	var options = "<option>ALL</option>";
	if(isShowAll==1){
		options = "";
	}else if(isShowAll == 2){
		options = "<option>请选择</option>";
	}
	
	if(items == 'undefined' || typeof(items) == 'undefined'){
		return options;
	}
	
	for(var i=0;i<items.length;i++){
		if(modelType=="baseName" || modelType=="tailNr" || modelType=="fleet"
			|| modelType=="company" || modelType=="customer"  || modelType=="depCd"|| modelType=="personName"){
			if(null!=val&&''!=val&&val==items[i]){
				op = "<option value='"+items[i]+"' selected='selected'>"+items[i]+"</option>";
			}else{
				op = "<option value='"+items[i]+"'>"+items[i]+"</option>";
			}
			
		}
		options = options + op;
	}
	return options;
}
function getCodeAndNameByType(type){
	var url =  baseURL+'/enumberation/getCodeAndNameByType.action';
	var list = null;
	$.ajax({
		url : url + '?type='+type,
		async : false,
		success : function(json) {
			if (typeof (json) == "string"){
				json = eval("(" + json + ")");
			}
			list = json.list;
		}
	});
	return list;
}